#include "Test.h"
#include <iostream>
#include <string.h>

using namespace std;

Test::Test()//无参构造函数
{
        a = 10;
        p = (char *)malloc(sizeof("aaabbccddff"));
        strcpy(p, "aaabbccddff");
        cout<< "我是"<<p<<"无参构造函数"<<endl;
}

void Test::print()
{
        cout<<p<<endl;
        cout<<a<<endl;
}

Test::~Test()
{
        if(p != NULL){
                free(p);
        }
        cout<< "我是析够函数"<<endl;
}